package EncryptMd5

import (
	"crypto/md5"
	"fmt"
	"io"
)

/**
md5通用加密
 */
func Md5(dataBytes string) (string, error) {
	md5Util := md5.New()
	_, err := io.WriteString(md5Util, dataBytes)
	if err != nil {
		return "", err
	}
	endBytes:= md5Util.Sum(nil)
	md5Str:= fmt.Sprintf("%x", endBytes)
	return md5Str, nil
}
